package demo1;

import java.util.Arrays;
/**
 * 优先队列的实现
 * */
public class Test {
    public static void main(String[] args) {
        TestHeap testHeap = new TestHeap();
        int[] array={27,15,19,18,28,34,65,49,25,37};
        testHeap.initArray(array);//完成初始化
        testHeap.cerateHeap();//创建小大根堆
        //testHeap.cerateHeap1();//创建小根堆
        testHeap.offer(80);
        System.out.println(testHeap.peek());//查看堆顶元素
        testHeap.poll();//出队
        System.out.println(testHeap.peek());//出队后再查看
        testHeap.heapSort();

    }
}
